﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace STDTO.Interfaces
{
    /// <summary>
    /// This inteface expose the data trasfer object functionalty
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface ISelfTrackingDataTransferObject<T>
    {
        /// <summary>
        /// Populate the DTO object by the given entity
        /// </summary>
        /// <param name="entity"></param>
        void Populate(T entity);
        /// <summary>
        /// Create a DTO clone - Server side object holds the same value as the dto
        /// </summary>
        /// <param name="getOriginalValue">if true all the changes made to the DTO object since the propulate we be undo</param>
        /// <returns></returns>
        T Clone(bool getOriginalValue);
        /// <summary>
        /// Simulate the changes made on the DTO object on the given entity ("plays" the changes)
        /// </summary>
        /// <param name="enitity"></param>
        void ApplyChanges(T enitity);
    }
}
